package com.sharein.auth.actions;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sharein.auth.beans.User;
import com.sharein.auth.business.UserManager;

public class GetSignedInUser implements Action {

	@Override
	public boolean execute(HttpServletRequest request,
			HttpServletResponse response) throws IOException {
		User user = UserManager.getSignedInUser(request);
		if(user == null) response.getWriter().write("0");
		else response.getWriter().write(user.getShareinID());
		return true;
	}

}
